package com.yx.server.base;


import com.yx.server.util.ConstantUtil;

import java.util.Map;

public class DefaultQuery implements IQuery {

    private Integer start = 1;
    private Integer length = ConstantUtil.PAGE_SIZE;
    private String showType = "0";
    private String sortOrder;

    @Override
    public Integer getStart() {
        if (null == start || start <= 0) {
            start = 1;
        }
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    @Override
    public Integer getLength() {
        if (null == length || length <= 0) {
            length = ConstantUtil.PAGE_SIZE;
        }
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public String getShowType() {
        return showType;
    }

    public void setShowType(String showType) {
        this.showType = showType;
    }

    @Override
    public String sortOrder() {
        return sortOrder;
    }

    public void sortOrder(String sortOrder) {
        this.sortOrder = sortOrder;
    }

    @Override
    public Map<String, Object> params() {
        return null;
    }
}